﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using IDAL.RF.PowerTest;
using Model.RF.PowerTest;

namespace DAL.RF.PowerTest
{
    public class PowerTestStatistics : BaseRepository_DT<PowerTestStatisticsInfo>, IPowerTestStatistics
    {
        #region 数据检索部分
        public IList<PowerTestStatisticsInfo> LoadEntities()
        {
            return null;
        }

        public PowerTestStatisticsInfo LoadEntity<T1>(T1 id)
        {
            return null;
        }

        public IList<PowerTestStatisticsInfo> GetPowerTestStatisticsbyDT(DateTime starttime, DateTime stoptime)
        {
            SqlParameter[] parms = GetDTParameters();
            parms[0].Value = starttime;
            parms[1].Value = stoptime;
            return ExcuteSqlToGetEntities("PowerTest_statisticbyDT", parms);
        }
        #endregion


        #region 重写基类部分
        //-------------------------------------重写超类基础操作---------------------------------------------------------

        public override PowerTestStatisticsInfo GetEntityRecord(SqlDataReader rdr)
        {
            PowerTestStatisticsInfo pro = new PowerTestStatisticsInfo()
            {
                ProductTypeID = rdr.GetValue(0).ToString(),
                onceAmount = rdr.GetInt32(1),
                oncePassAmount = rdr.GetInt32(2),
                oncePassRate = rdr.GetDecimal(3),
                directRetestAmount = rdr.GetInt32(4),
                directRetestPassAmount = rdr.GetInt32(5),
                directRetestPassRate = rdr.GetDecimal(6),
                passRate = rdr.GetDecimal(7),
                retestAmount = rdr.GetInt32(8),
                retestPassAmount = rdr.GetInt32(9),
                retestRate = rdr.GetDecimal(10),
                PassAmount = rdr.GetInt32(11),
                Amount = rdr.GetInt32(12),
                rate = rdr.GetDecimal(13)

                //CouplerValue=rdr.GetValue(14).ToString()
            };
            return pro;
        }

        public override PowerTestStatisticsInfo GetEntityRecord()
        {
            PowerTestStatisticsInfo pro = new PowerTestStatisticsInfo();
            return pro;
        }

        public override string GetInsertsp()
        {
            return null;
        }

        public override string GetUpdatesp()
        {
            return null;
        }

        public override string GetDeletesp()
        {
            return null;
        }
        #endregion
    }
}
